program sps1;

{$APPTYPE CONSOLE}

uses
  SysUtils;

procedure add(var head:pelement num:integer);
var
  current:pelement;
begin
  current:=head;
  if (current^.next<>nil) then
  begin
    while (current^.next<>nil) do
      begin
        current:=current^.next;
      end;
    new(current^.next);
    current^.next^.value:=num;
    current^.next^.next:=nil;
  end else begin
    add(head, num);
  end;
end;

procedure swp(var head:pelement);
var
  i, j:integer;
  current:pelement;
  mass:array of integer;
begin
  current:=head;
  i:=1;
  while (current<>nil) do
    begin
      i:=i+1;
      current:=current^.next;
    end;
   setlength(mass,i);
   current:=head
   for j:=0 to




begin



end.
